from django.db import models
from django.contrib.auth.models import AbstractUser
import requests
# Create your models here.
class MyUser(AbstractUser):
    head = models.ImageField(verbose_name="头像",upload_to="head",default="default_head/default_img.png")
    phone = models.CharField(verbose_name="手机号",max_length=11,blank=True,null=True)
    class Meta:
        verbose_name = "用户"
        verbose_name_plural = "用户"

class WeiBoUser(models.Model):
    wei_bo_user = models.CharField(verbose_name="微博用户id",max_length=100)
    http_user = models.OneToOneField(verbose_name="网页用户",to=MyUser,on_delete=models.CASCADE)
    def __str__(self):
        return self.wei_bo_user
    class Meta:
        verbose_name = "微博用户"
        verbose_name_plural = "微博用户"
